package com.zh.rent.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zh.rent.dao.GuideDao;
import com.zh.rent.pojo.Guide;
import com.zh.rent.service.IGuideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class IGuideServiceImpl implements IGuideService {
    @Autowired
    GuideDao guideDao;

    @Override
    public int insetGuide(Guide guide) {
        return guideDao.insetGuide(guide);
    }

    @Override
    public PageInfo<Guide> selguiUrl(Integer pageNum, Integer pageSeiz, Map<String,Object> map) {
        PageHelper.startPage(pageNum,pageSeiz);
        List<Guide> guides = guideDao.selguiUrl(map);
        return new PageInfo<>(guides);
    }

    @Override
    public PageInfo<Map<String, Object>> selguiFee(Integer pageNum, Integer pageSeiz, Map<String, Object> map) {
        PageHelper.startPage(pageNum,pageSeiz);
        List<Map<String, Object>> list = guideDao.selguiFee(map);

        return new PageInfo<>(list);
    }

    @Override
    public int delguide(Integer guideid) {
        return guideDao.delguide(guideid);
    }

    @Override
    public int delguideAll(List<Integer> list) {
        return guideDao.delguideAll(list);
    }

    @Override
    public int updateGuide(Guide guide) {
        return guideDao.updateGuide(guide);
    }

    @Override
    public List<Guide> selguiint(int pathType) {
        return guideDao.selguiint(pathType);
    }

    @Override
    public int insetGuidefeedback(Map<String,Object> map) {
        return guideDao.insetGuidefeedback(map);
    }

    @Override
    public List<Map<String, Object>> selguiAccountid() {
        return guideDao.selguiAccountid();
    }


}
